﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Summary.master" AutoEventWireup="true"
    CodeFile="GradeLevel.aspx.cs" Inherits="School_GradeLevel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="DetailHeaderContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="DetailBodyContent" runat="Server">
    <asp:UpdatePanel ID="uplGradeLevel" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gvGradeLevel" runat="server" Width="550px" AutoGenerateColumns="false"
                CssClass="table" ShowFooter="true" OnPageIndexChanging="OnPaging" OnRowEditing="EditGradeLevel"
                OnRowUpdating="UpdateGradeLevel" OnRowCancelingEdit="CancelEdit" PageSize="10"
                OnRowDataBound="gvGradeLevel_RowDataBound" OnRowCreated="gvGradeLevel_RowCreated">
                <Columns>
                    <asp:TemplateField ItemStyle-Width="30px" HeaderText="GradeLevelID" Visible="false">
                        <ItemTemplate>
                            <asp:Label ID="lblGradeLevelID" runat="server" Text='<%# Eval("GradeLevelID")%>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtGradeLevelID" ReadOnly="true" Text="-1" Width="40px" MaxLength="5"
                                runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="100px" HeaderText="Title">
                        <ItemTemplate>
                            <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("Title")%>' MaxLength="120"></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtTitle" runat="server" MaxLength="120"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="ShortName">
                        <ItemTemplate>
                            <asp:Label ID="lblShortName" runat="server" Text='<%# Eval("ShortName")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtShortName" runat="server" Text='<%# Eval("ShortName")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtShortName" runat="server" MaxLength="20"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Sort Order">
                        <ItemTemplate>
                            <asp:Label ID="lblSortOrder" runat="server" Text='<%# Eval("SortOrder")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtSortOrder" runat="server" Text='<%# Eval("SortOrder")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtSortOrder" runat="server" MaxLength="2"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Next Grade">
                        <ItemTemplate>
                            <asp:Label ID="lblNextGradeLevel" runat="server" Text='<%# Eval("NextGradeLevelTitle")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="ddlNextGradeLevel" runat="server" Width="150px">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:DropDownList ID="ddlNextGradeLevel" runat="server" Width="150px">
                            </asp:DropDownList>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Active">
                        <ItemTemplate>
                            <asp:Label ID="lblActive" runat="server" Text='N/A'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="chkActive" runat="server" Text=''></asp:CheckBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:CheckBox ID="chkActive" runat="server" Text=''></asp:CheckBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkRemove" runat="server" CommandArgument='<%# Eval("GradeLevelID")%>'
                                OnClientClick="return confirm('Do you want to delete?')" Text="Delete" OnClick="DeleteGradeLevel"></asp:LinkButton>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="AddGradeLevel" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" />
                </Columns>
                <AlternatingRowStyle CssClass="alt" />
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gvGradeLevel" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
